package com.hn.project.rqinspect.controller;

import com.hn.doc.xyj.annotation.Api;
import com.hn.framework.web.domain.AjaxResult;
import com.hn.project.rqinspect.domain.dto.QuesPartItemDto;
import com.hn.project.rqinspect.domain.vo.QuesPartItemVO;
import com.hn.project.rqinspect.service.QuesService;
import com.hn.utils.AssertUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 问卷
 *
 * @author admin
 */
@Api("问卷")
@RestController
@RequestMapping("ques")
public class QuesController {

    @Autowired
    private QuesService quesService;

    /**
     * 根据部位类型查询巡检问卷下面的检查项列表
     */
    @Api(value = "根据部位类型查询巡检问卷下面的检查项列表",result = QuesPartItemDto.class)
    @GetMapping("listQuesPartItem")
    public AjaxResult listQuesPartItem(QuesPartItemVO quesPartItemVO){
        AssertUtils.notNull(quesPartItemVO.getTaskRecordId(),"请选择巡检任务");
        AssertUtils.notNull(quesPartItemVO.getPartTypeId(),"请选择所属部位");
        return AjaxResult.success(quesService.listQuesPartItem(quesPartItemVO));
    }

}
